import React, { Component } from 'react';
// 统一数据源
import MyContext from '../context/store'

class Cmp1 extends Component {
  // 能让你使用 this.context 来消费最近 Context 上的那个值
  // static contextType = myContext


  render() {
    // console.log(this.context);
    return (
      <div>
        {/* {this.context.title} */}
        <MyContext.Consumer>
          {
            value => <div>{value.count}</div>
          }
        </MyContext.Consumer>
      </div>
    );
  }
}

export default Cmp1;
